package 剑指offer.Month7_07.day12;

public class 数值的整次方 {
    public double Power(double base, int exponent) {
        if(exponent < 0){
            base = 1 / base;
            exponent = -exponent;
        }
        double res = 1.0;
        for (int i = 0; i < exponent; i++) {
            res *= base;
        }
        return res;
    }
}
